package com.luych.toolbox.gateway.center.websocket;

import com.luych.toolbox.common.feign.param.gateway.center.*;

public class WebSocketMessage {

    private final Type type;
    private final Object message;


    public WebSocketMessage(WebSocketNotice notice) {
        this.type = Type.NOTICE;
        this.message = notice;
    }

    public WebSocketMessage(WebSocketLetter letter) {
        this.type = Type.LETTER;
        this.message = letter;
    }

    public WebSocketMessage(WebSocketChat chat) {
        this.type = Type.CHAT;
        this.message = chat;
    }

    public WebSocketMessage(WebSocketEvent event) {
        this.type = Type.EVENT;
        this.message = event;
    }

    public WebSocketMessage(WebSocketTask task) {
        this.type = Type.TASK;
        this.message = task;
    }

    public Type getType() {
        return type;
    }

    public Object getMessage() {
        return message;
    }

    public static enum Type {
        NOTICE, LETTER, CHAT, EVENT, TASK
    }
}
